package com.itmuch.cloud.study.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.itmuch.cloud.study.user.entity.User;
import com.netflix.hystrix.exception.HystrixBadRequestException;

@Service
public class UserService
{
    @Autowired
    RestTemplate restTemplate;

    /**
     * 抛出异常测试容错
     * 
     * @param id
     * @return
     * @see [类、类#方法、类#成员]
     */
    public User findById(Long id)
    {
        throw new HystrixBadRequestException("business exception happens.", new Exception(""));
    }
}
